<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\1\6 0006
 * Time: 14:58
 */
namespace app\api\model;
use think\Model;

class AppException extends Model {
    // 自动写入时间戳
    protected $autoWriteTimestamp = true;

    protected $createTime = 'create_time';

    protected $updateTime = '';

    protected $dateFormat = 'Y-m-d H:i:s';

    /**
     * 获取app异常信息
     * @author 王柯 <wangke.email@foxmail.com>
     * @return mixed
     */
    public function getTypeAttr($value){
        $type = [
            null => null,
            1 => 'crash',        //崩溃
            2 => '卡顿',         //卡顿
            3 => 'exception',   //异常信息
            4 => 'anr',         //应用程序无响应或者响应超时
        ];
        return $type[$value];
    }

}